package com.hcy.asyncfiledownload.datamodule.service.provider;

import com.hcy.asyncfiledownload.common.entry.ExportRecord;
import com.hcy.asyncfiledownload.datamodule.service.provider.ExportHandler;

/**
 * @Author huchenying
 * @Date 2022/9/6 16:29
 * @Description provider在线程池中执行的包装类
 */
public class RunnerProvider implements Runnable {

    private final ExportHandler handler;

    private final ExportRecord record;

    public RunnerProvider(ExportHandler handler, ExportRecord record) {
        this.handler = handler;
        this.record = record;
    }

    @Override
    public void run() {
        handler.afterProperties(record);
        handler.handler();
    }
}
